package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.每周销售顾问目标Model;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by lusong on 2016/12/2.
 */
public interface 每周销售顾问目标Repository extends JpaRepository<每周销售顾问目标Model, Integer>, JpaSpecificationExecutor<每周销售顾问目标Model> {

    @Query("select a from 每周销售顾问目标Model a where a.许可 =?1 and a.年月 =?2 and a.车型 =?3 and a.第N周 =?4")
    List<每周销售顾问目标Model> findCountByPermitAndYMAndCarCodeAndWeek(String permit, String yearMonth, String carCode, String week);


    @Query("select a from 每周销售顾问目标Model a where a.许可 =?1 and a.年月 =?2 and a.车型 =?3 and a.第N周 =?4 and a.销售顾问 = ?5")
    每周销售顾问目标Model findCountByPermitAndYMAndCarCodeAndWeekAndScCode(String permit, String yearMonth, String carCode, String week, String scCode);
}
